package servlets;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class BaseServlet extends HttpServlet {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	protected void redirect(HttpServletResponse response, String page, boolean b)
			throws ServletException, IOException {
		response.sendRedirect(this.getServletContext().getContextPath() + page);
	}

	protected void forward(HttpServletRequest request,
			HttpServletResponse response, String page) throws ServletException,
			IOException {
		RequestDispatcher dispatch = request.getRequestDispatcher(page);
		dispatch.forward(request, response);
	}

}
